﻿@model IEnumerable<Sample.Domain.Product>

@{
    ViewBag.Title = "Products";
}

<h2>Products</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(m => m.Name)
        </th>
        <th>
            @Html.DisplayNameFor(m => m.Price)
        </th>
        <th>
            @Html.DisplayNameFor(m => m.Discontinued)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink(item.Name, "Edit", new { id = item.Id })<p class="text-muted"><small>@Html.DisplayFor(modelItem => item.Details)</small></p>
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Price)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Discontinued)
        </td>
        <td>
            @Html.ActionLink("Delete", "Delete", new { id = item.Id })
        </td>
    </tr>
}

</table>
